package com.yunquan.ohana.entity

import cn.jiguang.bx.c
import com.yunquan.ohana.utils.ColorData
import com.yunquan.ohana.utils.ColorUtil

data class ListsEntity(
    var color: String? = null,
    var createTime: String? = null,
    var id: String? = null,
    var isShow: Int? = null,
    var name: String? = null,
    var quantityToBeCompleted: String? = null,
    var updateTime: String? = null,
    var userId: String? = null,
) {
    fun getColorData(): ColorData {
        val colorIndex = color?.toInt() ?: 0
        if (colorIndex >= 0) {
            return ColorUtil.getColor(colorIndex)
        }
        return ColorUtil.getColor(0)
    }
}

data class ListsItemEntity(
    var color: String? = null,
    var content: String? = null,
    var createTime: String? = null,
    var id: String? = null,
    var listsId: String? = null,
    var type: Int? = null,
    var updateTime: String? = null,
) {
    fun getColorData(): ColorData {
        val colorIndex = color?.toInt() ?: 0
        if (colorIndex >= 0) {
            return ColorUtil.getColor(colorIndex)
        }
        return ColorUtil.getColor(0)
    }
}